import re

'''
传入正则规则，看是不满足
'''


def re_search(rule, sentence):
    pattern = re.compile(rule)
    match = pattern.search(sentence)
    return match


if __name__ == '__main__':

    sentence = u'大大后天太阳太大'

    rule = u"大*大后天"
    match = re_search(rule, sentence)
    print(f'match{match}')
    if match is not None:
        print(f'match{match[0]}')
        rule = u"大"
        pattern = re.compile(rule)
        match1 = pattern.findall(match[0])
        print(match1)
        print(f'rule1  shiftdays  {2 + len(match1)}')
